package com.sangfor.ssl.l3vpn.service.networkInfo;

import com.sangfor.bugreport.logger.Log;

/* loaded from: classes2.dex */
public class PackageNames {
    private static final String TAG = "PackageNames";
    private final String[] pkgs;

    public int describeContents() {
        return 0;
    }

    public static PackageNames newInstance(String[] strArr) {
        return new PackageNames(strArr);
    }

    public String getAt(int i) {
        String[] strArr = this.pkgs;
        if (strArr.length > i) {
            return strArr[i];
        }
        return null;
    }

    public int getSize() {
        return this.pkgs.length;
    }

    public boolean contains(String str) {
        if (this.pkgs == null || str == null) {
            Log.info(TAG, "params is invalid!!");
            return false;
        }
        int size = getSize();
        for (int i = 0; i < size; i++) {
            if (getAt(i).equals(str)) {
                return true;
            }
        }
        return false;
    }

    protected PackageNames(String[] strArr) {
        this.pkgs = strArr;
    }

    public String toString() {
        String str = "";
        if (this.pkgs != null) {
            for (int i = 0; i < getSize(); i++) {
                str = str + this.pkgs[i] + ",";
            }
            return str.substring(0, str.lastIndexOf(","));
        }
        return "";
    }
}
